Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Maven artifact classifers #92

Closed
wants to merge 1 commit into from
Closed

Add support for Maven artifact classifers #92

wants to merge 1 commit into from

Conversation

celkins
Copy link

@celkins celkins commented Aug 27, 2013

Replaces brittle splitting/joining with parsing of coordinates by nexus_cli. Support for classifiers is mostly a side-effect.

The addition of a method similar to NexusCli::Artifact:file_name based on providers/deploy.rb:63-67 would make the code here completely classifier ignorant.

@KAllan357
Copy link
Contributor

I am 👍 on this. My only question is to ask what your thoughts are on the usage of chef_gem "nexus_cli" and require 'nexus_cli'? I am slightly worried that the more heavily we depend on the API of the nexus_cli gem, the more we need to be absolutely sure it has been installed and required in every possible code path. Since this is a cookbook, we can't do something nice like put the requires at the top of the file.

version = coordinates.split(':')[3]
if Chef::Artifact.latest?(version)
artifact = NexusCli::Artifact.new(coordinates)
if Chef::Artifact.latest?(artifact.version)
REXML::Document.new(remote.get_artifact_info(coordinates)).elements["//version"].text
else
version
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be artifact.version to handle cases where the version isn't 'latest'

@JonMR
Copy link

JonMR commented Oct 23, 2013

+1 for this, it's why I initially created the pull request for maven classifiers in nexus_cli.

KAllan357 referenced this pull request in aaronfeng/artifact-cookbook Oct 30, 2013
the original code assumed whatever value after
the extension is the version.  This is not
necessary true since the classifier can come
between the version and extension.
@KAllan357
Copy link
Contributor

Thank you! Merged in with #107

@KAllan357 KAllan357 closed this Oct 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants